package com.bsoft.hospitalchs.ui.child;


import android.content.Context;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.bsoft.hospitalchs.adapter.LeftmenuAdapter;
import com.bsoft.hospitalchs.base.BaseCommonPresenter;
import com.bsoft.hospitalchs.model.LeftMenuBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 泅渡者
 * Created on 2017/5/18.
 */

public class ChildInfoPresenter extends BaseCommonPresenter<ChildInfoContract.View> implements ChildInfoContract.Presenter {

    private List<LeftMenuBean> leftMenuBeen;
    private LeftmenuAdapter leftmenuAdapter;
    private ChildInfoContract.View myview;

    public ChildInfoPresenter(ChildInfoContract.View view, Context context) {
        super(view, context);
        leftMenuBeen = new ArrayList<>();
        this.myview = view;
    }

    @Override
    public void setLeftMenu(final FragmentActivity activity, ListView listView, final int frameLayout) {
        leftMenuBeen.add(new LeftMenuBean("个人信息"));
        leftMenuBeen.add(new LeftMenuBean("预检登记"));
        leftMenuBeen.add(new LeftMenuBean("照片记录"));
        leftMenuBeen.add(new LeftMenuBean("诊疗进度"));
        leftMenuBeen.add(new LeftMenuBean("诊疗记录"));
        leftMenuBeen.add(new LeftMenuBean("满意度调查"));
        leftMenuBeen.add(new LeftMenuBean("预约登记"));
        leftMenuBeen.add(new LeftMenuBean("生长曲线"));
        leftmenuAdapter = new LeftmenuAdapter(context, leftMenuBeen);
        listView.setAdapter(leftmenuAdapter);
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                leftmenuAdapter.setChecked(position);
                myview.setFragment(position);
            }
        });
        myview.setFragment(0);
    }

}
